
function getUiObject(doc) {
    var result = {};
    
    var nodes = $("*", doc).get();  // get an Array
    nodes.forEach(function(node) {
        if (node.id) 
            result[node.id] = node;
    });
    
    return result;
}

function jsdump(str) {
  Components.classes['@mozilla.org/consoleservice;1']
            .getService(Components.interfaces.nsIConsoleService)
            .logStringMessage(str);
}

